home *** CD-ROM | disk | FTP | other *** search
- { SPX Library Version 3.0 Copyright 1993 Scott D. Ramsay }
-
- SPX_LIB allows users to retrieve multiple files from one large archive
- file.
-
- ───────────────────────────────────────────────────────────────────────────
- type
- tLibHandle = record
- open : pointer; { points to lib }
- cPos : longint; { current position }
- sPos : longint; { start position }
- size : longint; { size of file }
- end;
-
- tLibHandle is a file handle type used for reading a file from an archive
- ───────────────────────────────────────────────────────────────────────────
- type
- pSPXLib = ^tSPXLib;
- tSPXLib = object(tobjs)
-
-
- VARIABLES:
- open : boolean; { true = archive is open }
- directory : pointer; { data to the directory structure }
- fileCount : word; { number of files in the archive }
- dirfile : file; { archive file handle }
-
- ---------------------------------------------------
- constructor init(libName:string;LoadDir:boolean);
-
- Sets up the archive object.
-
- libName: name of archive file to load
- LoadDir: start off loading Directory intro memory
-
- ---------------------------------------------------
- procedure LoadDirectory; virtual;
-
- force loading of directory, if not already loaded.
-
- ---------------------------------------------------
- procedure FreeDirectory; virtual;
-
- free the directory from memory.
- ---------------------------------------------------
- procedure OpenFile(fileName:string;var fileHandle:tLibHandle);virtual;
-
- Open a file from the archive for reading.
-
- fileName: name of file (with out path name)
- fileHandle: the file handle to the file
- ---------------------------------------------------
- function ReadFile(var fileHandle:tLibHandle;var buffer;size:word):word;virtual;
-
- Read from the file.
-
- fileHandle: file handle
- buffer: buffer to place data
- size: number of bytes to read
- ---------------------------------------------------
- function PosOfFile(var fileHandle:tLibHandle):longint;virtual;
-
- Returns the current positon of the open file.
- ---------------------------------------------------
- function EndOfFile(var fileHandle:tLibHandle):boolean;
-
- Returns true if the current position has reached the end of the file
- ---------------------------------------------------
- procedure SeekFile(var fileHandle:tLibHandle;position:longint);virtual;
-
- Changes the current position of the file
- ---------------------------------------------------
- procedure CloseFile(var fileHandle:tLibHandle);virtual;
-
- Closes the file.
- ---------------------------------------------------
- function LoadVSPfile(fileName:string;var buff):integer;virtual;
-
- Automatically load a .vsp file from the archive.
- ---------------------------------------------------
- function LoadColorsfile(fileName:string;var buff):integer;virtual;
-
- Automatically load a .PAL / .COL from the archive.
- ---------------------------------------------------
- destructor done;virtual;
-
- Deallocate the object
- ---------------------------------------------------
-